function ask() {
  let xhttp = new XMLHttpRequest();
  xhttp.open('GET', '../json/sites.json', true)
  xhttp.send()
  xhttp.onload = function () {
    let a = JSON.parse(xhttp.response)
    traverse(a)
  }
}
ask()
function traverse(info) {
  for (let i = 0; i < info.sites.length; i++) {
    let a = document.createElement('tr')
    let b = document.getElementById('fuck')
    b.appendChild(a)
    let c = document.createElement('th')
    let e = document.createElement('th')
    a.appendChild(c)
    a.appendChild(e)
    let d = document.createTextNode(info.sites[i].name)
    let f = document.createTextNode(info.sites[i].url)
    c.appendChild(d)
    e.appendChild(f)
  }
}
function cons() {
  let x = document.getElementById('name')
  let y = document.getElementById('mail')
  console.log(x.value)
  console.log(y.value)
}
function addInfo() {
  let x = document.getElementById('name')
  let y = document.getElementById('mail')
  if (y.value === '') {
    alert('请输入网站地址')
  } else if(x.value === ''){
    alert('请输入站名')
  }
}

